package com.hdd.biz.app.controller;

import com.hdd.biz.app.dto.AppResponse;
import com.hdd.biz.app.dto.WXRegisterRequest;
import com.hdd.biz.app.service.RegisterService;
import com.hdd.biz.finance.dto.PaymetListRequest;
import com.hdd.dto.SuperResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/app/register")
@Api(value = "小程序-注册",tags = {"小程序-注册"})
public class RegisterController {


    @Autowired
    private RegisterService registerService;

    @PostMapping("/getInfoByOpenId")
    @ApiOperation(value = "根据OpendId获取用户信息" ,notes = "")
    public AppResponse info(@Valid @RequestBody WXRegisterRequest request ){
        return registerService.getOpenId(request);
    }



    @PostMapping("")
    @ApiOperation(value = "微信授权登录" ,notes = "")
    public AppResponse register(@Valid @RequestBody WXRegisterRequest request ){
        return registerService.register(request);
    }


}
